import { http } from "@/utils/http";

type ResultTable = {
  total?: number;
  data?: Array<any>;
};

//碳排放量溯源图
export const accountingEmissionDatatraceability = (data?: object) => {
  return http.request<ResultTable>("post", `/energy/accountingEmissionData/traceability`, {
    data
  });
};

//碳排放量数据分析
export const accountingEmissionDatagetEmissionAnalysis = (data?: object) => {
  return http.request<ResultTable>("post", `/energy/accountingEmissionData/getEmissionAnalysis`, {
    data
  });
};

//碳排放设施活动分析（饼图）
export const accountingEmissionDatagetFacilityAnalysisPie = (data?: object) => {
  return http.request<ResultTable>("post", `/energy/accountingEmissionData/getFacilityAnalysisPie`, {
    data
  });
};

//碳排放设施活动分析（饼图）
export const accountingEmissionDatagetFacilityAnalysisLine = (data?: object) => {
  return http.request<ResultTable>("post", `/energy/accountingEmissionData/getFacilityAnalysisLine`, {
    data
  });
};

//排放类别碳排放量占比统计
export const accountingEmissionDatagetCategoryPieBar = (data?: object) => {
  return http.request<ResultTable>("post", `/energy/accountingEmissionData/getCategoryPieBar`, {
    data
  });
};

//碳排放设施活动分析折线图-柱状图
export const accountingEmissionDatagetFacilityAnalysisLineBar = (data?: object) => {
  return http.request<ResultTable>("post", `/energy/accountingEmissionData/getFacilityAnalysisLineBar`, {
    data
  });
};

//碳排放总览-碳排放分析-单位产量统计及趋势图
export const accountingEmissionDatagetProductionStatisticTrend = (data?: object) => {
  return http.request<ResultTable>("post", `/energy/accountingEmissionData/getProductionStatisticTrend`, {
    data
  });
};

//碳排放总览-碳排放分析-碳排放总量
export const accountingEmissionDatagetFactoryEmission = (data?: object) => {
  return http.request<ResultTable>("post", `/energy/accountingEmissionData/getFactoryEmission`, {
    data
  });
};

//碳排放总览-碳排放分析-排放类别占比
export const accountingEmissionDatagetCategoryEmissionYoy = (data?: object) => {
  return http.request<ResultTable>("post", `/energy/accountingEmissionData/getCategoryEmissionYoy`, {
    data
  });
};

//碳排放总览-碳排放厂区对比-单位产量趋势图
export const accountingEmissionDatagetProductionFactoryTrend = (data?: object) => {
  return http.request<ResultTable>("post", `/energy/accountingEmissionData/getProductionFactoryTrend`, {
    data
  });
};

//碳排放总览-碳排放类别分析-设施活动排行
export const accountingEmissionDatagetFacilityRank = (data?: object) => {
  return http.request<ResultTable>("post", `/energy/accountingEmissionData/getFacilityRank`, {
    data
  });
};

//碳排放总览-碳排放类别分析-排放类别厂区对比列表
export const accountingEmissionDatagetFactoryCategoryComparisonList = (data?: object) => {
  return http.request<ResultTable>("post", `/energy/accountingEmissionData/getFactoryCategoryComparisonList`, {
    data
  });
};

//碳排放总览-碳排放类别分析-排放类别厂区对比趋势图
export const accountingEmissionDatagetFactoryCategoryComparisonTrend = (data?: object) => {
  return http.request<ResultTable>("post", `/energy/accountingEmissionData/getFactoryCategoryComparisonTrend`, {
    data
  });
};

//当从二级分类点击明细跳到设施活动得时候，传facilityId 设施活动ID这个数组字段，调用
export const accountingEmissionDataemissionTrend = (data?: object) => {
  return http.request<ResultTable>("post", `/energy/accountingEmissionData/emissionTrend`, {
    data
  });
};

//当从二级分类点击明细跳到设施活动得时候，传facilityId 设施活动name这个数组字段，调用
export const accountingEmissionDataemissionTrendByFacilityName = (data?: object) => {
  return http.request<ResultTable>("post", `/energy/accountingEmissionData/emissionTrendByFacilityName`, {
    data
  });
};
